---
layout: m1x_soap
title: Product Custom Value Add
---

<h3><a name="product_custom_option_value.add-Module%3AComplexProductAPI"></a>Module: Complex Product API</h3>


<h4><a name="product_custom_option_value.add-Resource%3Aproductcustomoptionvalue"></a>Resource: product_custom_option_value</h4>


<h5><a name="product_custom_option_value.add-Method%3A"></a>Method:</h5>

<ul>
	<li>product_custom_option_value.add (SOAP V1)</li>
	<li>catalogProductCustomOptionValueAdd (SOAP V2)</li>
</ul>


<p>Allows you to add a new custom option value to a custom option. Note that the custom option value can be added only to the option with the <b>Select</b> Input Type.</p>

<p><b>Arguments:</b></p>

<table><tbody>
<tr>
<th> Type </th>
<th> Name </th>
<th> Description </th>
</tr>
<tr>
<td> string </td>
<td> sessionId </td>
<td> Session ID </td>
</tr>
<tr>
<td> string </td>
<td> optionId <br class="atl-forced-newline" /> </td>
<td> Option ID </td>
</tr>
<tr>
<td> array </td>
<td> data </td>
<td> Array of catalogProductCustomOptionValueAdd </td>
</tr>
<tr>
<td> string </td>
<td> store </td>
<td> Store view ID or code (optional) </td>
</tr>
</tbody></table>


<p><b>Return:</b></p>

<table><tbody>
<tr>
<th> Type </th>
<th> Description </th>
</tr>
<tr>
<td> boolean </td>
<td> True if the custom option value is added </td>
</tr>
</tbody></table>


<p>The <b>catalogProductCustomOptionValueAdd</b> content is as follows:</p>

<table><tbody>
<tr>
<th> Type </th>
<th> Name </th>
<th> Description </th>
</tr>
<tr>
<td> string </td>
<td> title <br class="atl-forced-newline" /> </td>
<td> Custom option value title </td>
</tr>
<tr>
<td> string <br class="atl-forced-newline" /> </td>
<td> price <br class="atl-forced-newline" /> </td>
<td> Custom option value price </td>
</tr>
<tr>
<td> string <br class="atl-forced-newline" /> </td>
<td> price_type <br class="atl-forced-newline" /> </td>
<td> Type of the custom option value price. Can have one of the following values:&nbsp;"fixed" or "percent" </td>
</tr>
<tr>
<td> string <br class="atl-forced-newline" /> </td>
<td> sku <br class="atl-forced-newline" /> </td>
<td> Custom option value row SKU </td>
</tr>
<tr>
<td> string <br class="atl-forced-newline" /> </td>
<td> sort_order <br class="atl-forced-newline" /> </td>
<td> Custom option value sort order </td>
</tr>
</tbody></table>


<p><b>Faults:</b></p>

<table><tbody>
<tr>
<th> Fault Code </th>
<th> Fault Message </th>
</tr>
<tr>
<td> 101 </td>
<td> Option value with requested id does not exist. </td>
</tr>
<tr>
<td> 102 </td>
<td> Error while adding an option value. Details are in the error message. </td>
</tr>
<tr>
<td> 104 </td>
<td> Invalid option type. </td>
</tr>
</tbody></table>


<h4><a name="product_custom_option_value.add-Examples"></a>Examples</h4>

<h5><a name="product_custom_option_value.add-RequestExampleSOAPV1"></a>Request Example SOAP V1</h5>

<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<div>
		<pre class="theme: Default; brush: php; gutter: false">$proxy = new SoapClient('http://magentohost/api/soap/?wsdl');
$sessionId = $proxy-&gt;login('apiUser', 'apiKey');
$productOptionId = 1;// Existing product option ID

// Add custom option value
$customOptionValue = array(
    "title" =&gt; "Some value text 1",
    "price" =&gt; 10.00,
    "price_type" =&gt; "fixed",
    "sku" =&gt; "custom_text_option_sku",
    "sort_order" =&gt; 0
);
$resultCustomOptionValueAdd = $proxy-&gt;call(
    $sessionId,
    "product_custom_option_value.add",
    array(
        $productOptionId,
        array($customOptionValue)
    )
);</pre>
		</div>
</div></div>



<h5><a name="product_custom_option_value.add-RequestExampleSOAPV2"></a>Request Example SOAP V2</h5>

<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<div>
		<pre class="theme: Default; brush: php; gutter: false">$proxy = new SoapClient('http://magentohost/api/v2_soap/?wsdl');

$sessionId = $proxy-&gt;login('apiUser', 'apiKey');

$result = $proxy-&gt;catalogProductCustomOptionValueAdd($sessionId, '10', array(array(
'title' =&gt; 'value',
'price' =&gt; '99.99',
'price_type' =&gt; 'fixed',
'sku' =&gt; 'sku',
'sort_order' =&gt; '1'
)));
var_dump($result);</pre>
		</div>
</div></div>





<h5><a name="product_custom_option_value.add-RequestExampleSOAPV2%28WSIComplianceMode%29"></a>Request Example SOAP V2 (WS-I Compliance Mode)</h5>

<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<div>
		<pre class="theme: Default; brush: php; gutter: false">$proxy = new SoapClient('http://magentohost/api/v2_soap/?wsdl');

$sessionId = $proxy-&gt;login((object)array('username' =&gt; 'apiUser', 'apiKey' =&gt; 'apiKey'));

$result = $proxy-&gt;catalogProductCustomOptionValueAdd((object)array('sessionId' =&gt; $sessionId-&gt;result, 'optionId' =&gt; '10', 'data' =&gt; array(array(
'title' =&gt; 'value',
'price' =&gt; '99.99',
'price_type' =&gt; 'fixed',
'sku' =&gt; 'sku',
'sort_order' =&gt; '1'
))));
var_dump($result-&gt;result);</pre>
		</div>
</div></div>


